<?php
/**
 * Created by PhpStorm.
 * User: merlin
 * Date: 15-11-6
 * Time: 上午10:23
 */
function test($dirname)
{
    $dir_handle = opendir($dirname);

    $num = 0;
    while ($file = readdir($dir_handle)) {
        $num++;
        if ($file != "." && $file != "..") {
            echo $file . "\n";
        }
    }

    closedir($dir_handle);
}

test('/var/www/jkb_code/www/templates/mail/custom');
